package com.emapp.lccode.utils;

import android.content.Context;

import com.emapp.lccode.adapter.GridImageAdapter;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.interfaces.OnExternalPreviewEventListener;

/**
 * Author:YanshanZhang
 * E-mail:690810892@qq.com
 * Date: 2022/4/14 16:46
 * Desc:外部预览监听事件
 */
public class MyExternalPreviewEventListener implements OnExternalPreviewEventListener {
    private final GridImageAdapter adapter;

    public MyExternalPreviewEventListener(GridImageAdapter adapter) {
        this.adapter = adapter;
    }

    @Override
    public void onPreviewDelete(int position) {
        adapter.remove(position);
        adapter.notifyItemRemoved(position);
    }

    @Override
    public boolean onLongPressDownload(Context context, LocalMedia media) {
        return false;
    }

}
